<template>
    <el-scrollbar>
        <div class="scrollbar-flex-content">
            <p v-for="item in list" :key="item" class="scrollbar-demo-item">
                <img :src="item.img" alt="">
            </p>
        </div>
    </el-scrollbar>
</template>

<script setup>
import { ref } from 'vue';
const list = ref()

list.value = [
    {
        img: '../public/tab_img/1.webp'
    },
    {
        img: '../public/tab_img/2.webp'
    },
    {
        img: '../public/tab_img/3.webp'
    },
    {
        img: '../public/tab_img/4.webp'
    },
    {
        img: '../public/tab_img/5.webp'
    },
    {
        img: 'https://img1.baidu.com/it/u=7456317,4282812646&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500'
    },
    {
        img: 'https://img1.baidu.com/it/u=1814941428,1835608319&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500'
    },
    {
        img: 'https://img2.baidu.com/it/u=58915055,1355296400&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500'
    },
    {
        img: 'https://img1.baidu.com/it/u=2408578830,2849991118&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500'
    },
    {
        img: 'https://img2.baidu.com/it/u=1838040407,1274103844&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800'
    }
]
</script>

<style scoped>
.scrollbar-flex-content {
    display: flex;
}

.scrollbar-demo-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 100px;
    margin: 10px;
    text-align: center;
    border-radius: 4px;
    background: var(--el-color-danger-light-9);
    color: var(--el-color-danger);
}

.scrollbar-demo-item:hover {
    width: 160px;
    height: 110px;
    margin: 5px;
    cursor: pointer;
}

img {
    width: 100%;
    height: 100%;
}
</style>